<template>
  <view class="container" :style="{height: `${windowHeight}px`}">
	  <!-- <uni-section title="库位调整" type="line"></uni-section> -->
	  <view style="padding-top: 10px;">
		<view class="content">
			<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="100px" >
				<u-form-item label="卷号" prop="form.vendorName" ref="item1">
					<u--input v-model="form.vendorName"></u--input>
					<uni-icons type="scan" size="30" style="margin-top: 4px;"  @click="vendorNameCode"></uni-icons>
				</u-form-item>
				<u-form-item label="库位号" prop="form.warehouseId" ref="item1">
					<u--input v-model="form.warehouseId"></u--input>
					<uni-icons type="scan" size="30" style="margin-top: 4px;"  @click="warehouseIdCode"></uni-icons>
				</u-form-item>
				<view style="padding-top: 20px;display: flex;margin-left: 100px;">
					<u-button type="primary" text="确定入库" style="width: 30%;"></u-button>
					<u-button type="primary" text="清空" style="width: 30%;"></u-button>
				</view>
			</u--form>
		</view>
	</view>
	<uni-section title="调整记录" type="line"></uni-section>
  </view>
</template>

<script>
	import { vendorList } from '@/api/fabricManagement/InventoryQuery.js'
  export default {
    data() {
      return {
		  loading: false,
        windowHeight: uni.getSystemInfoSync().windowHeight,
		form: {
			vendorName: null,
			warehouseId: null
		},
		rules:{},
      }
    },
	onLoad() {
		// this.getVendorList()
	},
    methods: {
	    clearModel() {
	    }, 
		async vendorNameCode() {
			const _ = this
			uni.scanCode({
				onlyFromCamera: true,
				success: function(res) {
					console.log(res.result)
					 _.form.vendorName = res.result
				}
			});
		},
		async warehouseIdCode() {
			const _ = this
			uni.scanCode({
				onlyFromCamera: true,
				success: function(res) {
					 _.form.warehouseId = res.result
				}
			});
		},
    }
  }
</script>

<style lang="scss" scoped>
  .container {
    background-color: #fff;
	padding: 5px;
  }
::v-deep {
  .u-form {
    .u-form-item {
      .u-form-item__body {
        padding: 5px 0 0 0;
      }
    }
  }
}
</style>
